import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName LC2154
 * @Author ykx
 * @Date 2024/6/30 16:56
 * @Version 1.0
 */
public class LC2154 {

    public static void main(String[] args) {

    }

    public int findFinalValue(int[] nums, int original) {
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            set.add(num);
        }

        while (set.contains(original)) {
            original *= 2;
        }

        return original;

    }

}
